package ch.uzh.ifi.seal.ssqa.util;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;

public class ColorHelper {
	/**
	 * returns the Color from Red to green over yellow according to a normalization of 100
	 * @param integer
	 * @return
	 */
	public static Color getNormalizedColor(double colordouble){
		Integer integer = (int) (colordouble * 5.1);
		Integer red = 255;
		Integer green = 255;
		
		if(integer>255){
			green = 510 - integer;
		} else {
			red = integer;
		}
		return new Color(null, new RGB(red, green, 0));
	}
}
